var TooltipDiv = (function() {
    var isInit = false;
    function _() {}
    _.initTool = function(frameDiv) {
      // if (isInit) {
      //   return;
      // }
      var popupDiv = document.createElement("div");
      popupDiv.className = "cesium-popup";

      var contentBoxDIV = document.createElement("div");
      contentBoxDIV.className = "cesium-popup-content-wrapper cesium-popup-background"
      popupDiv.appendChild(contentBoxDIV);

      var title = document.createElement("div");
      title.className = "cesium-popup-content cesium-popup-color";
      contentBoxDIV.appendChild(title);

      this._div = popupDiv;
      this._title = title;
      frameDiv.appendChild(popupDiv);
      isInit = true;
    };
  
    _.hide = function(visible) {
      if (!isInit) {
        return;
      }
      this._div.style.display = visible ? "block" : "none";
    };
  
    /*
      position屏幕坐标
      显示在屏幕上
      */
    _.show = function(position, message) {
      if (!isInit) {
        return;
      }
      if (position && message) {
        this.hide(true);
        this._title.innerHTML = message;
        this._div.style.position = "absolute";
        this._div.style.left = position.x + 30 + "px";
        this._div.style.top = position.y - this._div.clientHeight / 2 + "px";
      }
    };
    return _;
  })();
  
  export default TooltipDiv;